home *** CD-ROM | disk | FTP | other *** search
- global gTextLanguage, gHighLightPos, gCurrentPos, gNbItem, gCurrentField, gTermObj, gIndexPicObj, gScreenStatus, gReturnDialog, gSelection, gIndexChange, gIdxTermObj, gRealTextLanguage, gLabelLang
-
- on ShowIndex langueTemp
- global gPrgKey
- if gPrgKey = 8 then
- set gPrgKey to gPrgKey + 1
- else
- set gPrgKey to -10
- end if
- set LstSpriteVisible to [1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
- watchCursor()
- if (gScreenStatus = #ILLUSTRATION) or (gScreenStatus = #REGION) or (gScreenStatus = #ZOOM) then
- FlushAllAnimationsData()
- ResetActiveLabels()
- ResetScreenLists()
- EraseAll()
- end if
- set gReturnDialog to gScreenStatus
- GrabStage()
- addRAMobjects(#CastList, [10095, 10096, 10097, 10098, 10526, 10527, 10528, 10530, 10531, 10532, 10533, 10534, 10539, 10541, 10542, 10543, 10545, 10546, 10549, 10550, 10551, 10552, 10553, 10554, 10555])
- if gIndexChange then
- put " " into field 10096
- put " " into field 10097
- put " " into field 10098
- set gHighLightPos to [0, 0, 0]
- setAt(LstSpriteVisible, 9, 1)
- else
- if (gCurrentField > 0) and (gCurrentField < 4) then
- setAt(LstSpriteVisible, ((gCurrentField - 1) * 7) + 9, 1)
- end if
- end if
- repeat with i = 1 to 46
- set the visible of sprite i to getAt(LstSpriteVisible, i)
- set the cursor of sprite i to 0
- end repeat
- if not voidp(langueTemp) and (gTextLanguage <> langueTemp) then
- set gRealTextLanguage to gTextLanguage
- set gTextLanguage to langueTemp
- else
- set gRealTextLanguage to 0
- end if
- UpdateLabel()
- InitializeFiles()
- if the text of field 10095 = EMPTY then
- set the text of field 10095 to " "
- end if
- set the textFont of field 10095 to "IVD10"
- set the textSize of field 10095 to 10
- if gCurrentField <> 6 then
- set the foreColor of cast 10095 to 14
- set the backColor of cast 10095 to 199
- else
- set the foreColor of cast 10095 to 255
- set the backColor of cast 10095 to 0
- end if
- set the textSize of field 10096 to 10
- set the textHeight of field 10096 to 12
- set the textSize of field 10097 to 10
- set the textHeight of field 10097 to 12
- set the textSize of field 10098 to 10
- set the textHeight of field 10098 to 12
- set the locV of sprite 1 to 800
- puppetTransition(9, 0, 5)
- gotoframe(15)
- set gScreenStatus to #Index
- puppetTransition(0)
- if gIndexChange = 0 then
- set theLine to getAt(gHighLightPos, 1) - getAt(gCurrentPos, 1)
- if (theLine >= 0) and (theLine < 6) then
- set the locV of sprite 11 to ((getAt(gHighLightPos, 1) - getAt(gCurrentPos, 1)) * 12) + SpriteTop(10) + 1
- set the visible of sprite 11 to 1
- end if
- set theLine to getAt(gHighLightPos, 2) - getAt(gCurrentPos, 2)
- if (theLine >= 0) and (theLine < 6) and (gIndexChange = 0) then
- set the locV of sprite 18 to ((getAt(gHighLightPos, 2) - getAt(gCurrentPos, 2)) * 12) + SpriteTop(17) + 1
- set the visible of sprite 18 to 1
- end if
- set theLine to getAt(gHighLightPos, 3) - getAt(gCurrentPos, 3)
- if (theLine >= 0) and (theLine < 6) and (gIndexChange = 0) then
- set the locV of sprite 25 to ((getAt(gHighLightPos, 3) - getAt(gCurrentPos, 3)) * 12) + SpriteTop(24) + 1
- set the visible of sprite 25 to 1
- SpriteHandCursor(4)
- end if
- UpdateCursor(1, getAt(gCurrentPos, 1))
- UpdateCursor(2, getAt(gCurrentPos, 2))
- UpdateCursor(3, getAt(gCurrentPos, 3))
- end if
- set the castNum of sprite 6 to 10001
- set the castNum of sprite 7 to 10001
- set the height of sprite 10 to 72
- set the height of sprite 17 to 72
- set the height of sprite 24 to 72
- set the stretch of sprite 11 to 1
- set the height of sprite 11 to 12
- set the width of sprite 11 to the width of sprite 10
- set the locH of sprite 11 to getAt(the rect of sprite 10, 1)
- set the stretch of sprite 18 to 1
- set the height of sprite 18 to 12
- set the width of sprite 18 to the width of sprite 17
- set the locH of sprite 18 to getAt(the rect of sprite 17, 1)
- set the stretch of sprite 25 to 1
- set the height of sprite 25 to 12
- set the width of sprite 25 to the width of sprite 24
- set the locH of sprite 25 to getAt(the rect of sprite 24, 1)
- SpriteHandCursor(3)
- SpriteHandCursor(34)
- updateStage()
- if gCurrentField = 0 then
- set the editableText of sprite 5 to 1
- ActiveField(6)
- else
- ActiveField(gCurrentField)
- end if
- if gSelection <> EMPTY then
- if charToNum(chars(gSelection, 2, 2)) = 39 then
- set gSelection to chars(gSelection, 3, length(gSelection))
- end if
- set gHighLightPos to [1, 0, 0]
- set Temp1 to FindWordPos(gSelection)
- if Temp1 > 49999 then
- set Temp1 to Temp1 - 50000
- end if
- setAt(gHighLightPos, 1, Temp1)
- set gSelection to EMPTY
- end if
- if gIndexChange = 1 then
- ActiveField(1)
- set gIndexChange to 0
- if getAt(gHighLightPos, 1) > 0 then
- SetWindow1(1, 2)
- set the text of cast 10095 to FindWordP(getAt(gHighLightPos, 1), 0)
- FindTerms(getAt(gHighLightPos, 1))
- if getAt(gHighLightPos, 2) > 0 then
- SetWindow1(2, 2)
- FindPics(getAt(gHighLightPos, 2))
- if getAt(gHighLightPos, 3) > 0 then
- SetWindow1(3, 2)
- else
- set the visible of sprite 4 to 0
- ActiveButton(1)
- SetWindow1(3, 1)
- end if
- else
- put " " into field 10098
- ActiveButton(1)
- setAt(gCurrentPos, 2, 1)
- SetWindow1(2, 3)
- set the visible of sprite 25 to 0
- end if
- else
- set the text of cast 10095 to EMPTY
- put " " into field 10097
- put " " into field 10098
- ActiveButton(1)
- SetWindow1(1, 3)
- end if
- else
- if getAt(gHighLightPos, 1) > 0 then
- if getAt(gNbItem, 2) > 6 then
- set the visible of sprite 45 to 0
- end if
- if getAt(gHighLightPos, 2) > 0 then
- if getAt(gNbItem, 3) > 6 then
- set the visible of sprite 46 to 0
- end if
- end if
- end if
- end if
- if getAt(gHighLightPos, 3) > 0 then
- ActiveButton(2)
- else
- ActiveButton(1)
- end if
- cursor(-1)
- end
-
- on CloseIndex
- gTermObj(mdispose)
- gIdxTermObj(mdispose)
- set the editableText of sprite 5 to 0
- set the visible of sprite 47 to 1
- set the visible of sprite 48 to 1
- set gLabelLang to gTextLanguage
- if (gRealTextLanguage <> 0) and (gTextLanguage <> gRealTextLanguage) then
- set gTextLanguage to gRealTextLanguage
- set gHighLightPos to [0, 0, 0]
- set gIndexChange to 1
- else
- set gRealTextLanguage to 0
- end if
- set the stretch of sprite 11 to 0
- set the stretch of sprite 18 to 0
- set the stretch of sprite 25 to 0
- end
-
- on VerifyButtons
- global gCurrentField, gHighLightPos
- if getAt(gHighLightPos, 3) > 0 then
- if the foreColor of cast 10555 = 96 then
- set the foreColor of cast 10555 to 14
- if gCurrentField <> 4 then
- ActiveButton(2)
- end if
- SpriteHandCursor(4)
- end if
- else
- if the foreColor of cast 10555 = 14 then
- set the foreColor of cast 10555 to 96
- ActiveButton(1)
- set the cursor of sprite 4 to -1
- end if
- end if
- end
-
- on KeyDownIndex
- if (gCurrentField < 4) and (gCurrentField > 0) then
- set NbElement to getAt(gNbItem, gCurrentField)
- set HighL to getAt(gHighLightPos, gCurrentField)
- set CurrentP to getAt(gCurrentPos, gCurrentField)
- end if
- if the keyCode = 125 then
- if (gCurrentField = 1) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 5)))) then
- SetWindow1(1, 6)
- repeat while the shiftDown
- SetWindow1(1, 6)
- end repeat
- SetWindow1(2, 1)
- FindTerms(getAt(gHighLightPos, 1))
- setAt(gCurrentPos, 2, 1)
- setAt(gHighLightPos, 2, 0)
- SetWindow1(2, 3)
- else
- if (gCurrentField = 2) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 5)))) then
- SetWindow1(2, 6)
- repeat while the shiftDown
- SetWindow1(2, 6)
- end repeat
- FindPics(getAt(gHighLightPos, 2))
- setAt(gCurrentPos, 3, 1)
- setAt(gHighLightPos, 3, 0)
- SetWindow1(3, 3)
- else
- if (gCurrentField = 3) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 5)))) then
- SetWindow1(3, 6)
- end if
- end if
- end if
- dontPassEvent()
- abort()
- end if
- if the keyCode = 126 then
- if (gCurrentField = 1) and not ((HighL = 1) and (CurrentP = 1)) then
- SetWindow1(1, 5)
- repeat while the shiftDown
- SetWindow1(1, 5)
- end repeat
- SetWindow1(2, 1)
- FindTerms(getAt(gHighLightPos, 1))
- setAt(gCurrentPos, 2, 1)
- setAt(gHighLightPos, 2, 0)
- SetWindow1(2, 3)
- else
- if (gCurrentField = 2) and not ((HighL = 1) and (CurrentP = 1)) then
- SetWindow1(2, 5)
- repeat while the shiftDown
- SetWindow1(2, 5)
- end repeat
- FindPics(getAt(gHighLightPos, 2))
- setAt(gCurrentPos, 3, 1)
- setAt(gHighLightPos, 3, 0)
- SetWindow1(3, 3)
- else
- if (gCurrentField = 3) and not ((HighL = 1) and (CurrentP = 1)) then
- SetWindow1(3, 5)
- end if
- end if
- end if
- dontPassEvent()
- abort()
- end if
- if the keyCode = 115 then
- if (gCurrentField = 1) and not ((HighL = 1) and (CurrentP = 1)) then
- setAt(gCurrentPos, 1, 1)
- setAt(gHighLightPos, 1, 1)
- SetWindow1(1, 3)
- SetWindow1(2, 1)
- set ListResult to field 10096
- set the text of cast 10095 to line 1 of ListResult
- set the selEnd to the length of line 1 of ListResult
- set the selStart to the selEnd
- set the foreColor of cast 10095 to 14
- FindTerms(getAt(gHighLightPos, 1))
- setAt(gCurrentPos, 2, 1)
- setAt(gHighLightPos, 2, 0)
- SetWindow1(2, 3)
- else
- if (gCurrentField = 2) and not ((HighL = 1) and (CurrentP = 1)) then
- setAt(gCurrentPos, 2, 1)
- setAt(gHighLightPos, 2, 1)
- SetWindow1(2, 3)
- FindPics(1)
- setAt(gCurrentPos, 3, 1)
- setAt(gHighLightPos, 3, 0)
- SetWindow1(3, 3)
- else
- if (gCurrentField = 3) and not ((HighL = 1) and (CurrentP = 1)) then
- setAt(gCurrentPos, 3, 1)
- setAt(gHighLightPos, 3, 1)
- SetWindow1(3, 3)
- end if
- end if
- end if
- dontPassEvent()
- abort()
- end if
- if the keyCode = 119 then
- if (gCurrentField = 1) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 5)))) then
- setAt(gCurrentPos, 1, getAt(gNbItem, 1) - 5)
- setAt(gHighLightPos, 1, getAt(gNbItem, 1))
- SetWindow1(1, 3)
- SetWindow1(2, 1)
- set ListResult to field 10096
- set the text of cast 10095 to line 6 of ListResult
- set the selEnd to the length of line 6 of ListResult
- set the selStart to the selEnd
- set the foreColor of cast 10095 to 14
- FindTerms(getAt(gHighLightPos, 1))
- setAt(gCurrentPos, 2, 1)
- setAt(gHighLightPos, 2, 0)
- SetWindow1(2, 3)
- else
- if (gCurrentField = 2) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 5)))) then
- if getAt(gNbItem, 2) < 6 then
- setAt(gCurrentPos, 2, 1)
- else
- setAt(gCurrentPos, 2, getAt(gNbItem, 2) - 5)
- end if
- setAt(gHighLightPos, 2, getAt(gNbItem, 2))
- SetWindow1(2, 3)
- FindPics(getAt(gHighLightPos, 2))
- setAt(gCurrentPos, 3, 1)
- setAt(gHighLightPos, 3, 0)
- SetWindow1(3, 3)
- else
- if (gCurrentField = 3) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 5)))) then
- if getAt(gNbItem, 3) < 6 then
- setAt(gCurrentPos, 3, 1)
- else
- setAt(gCurrentPos, 3, getAt(gNbItem, 3) - 5)
- end if
- setAt(gHighLightPos, 3, getAt(gNbItem, 3))
- SetWindow1(3, 3)
- end if
- end if
- end if
- dontPassEvent()
- abort()
- end if
- if the keyCode = 116 then
- if (gCurrentField = 1) and not ((HighL = 1) and (CurrentP = 1)) then
- SetWindow2(1, 12)
- repeat while the shiftDown
- SetWindow2(1, 12)
- end repeat
- SetWindow1(2, 1)
- FindTerms(getAt(gHighLightPos, 1))
- setAt(gCurrentPos, 2, 1)
- setAt(gHighLightPos, 2, 0)
- SetWindow1(2, 3)
- else
- if (gCurrentField = 2) and not ((HighL = 1) and (CurrentP = 1)) then
- SetWindow2(2, 12)
- repeat while the shiftDown
- SetWindow2(2, 12)
- end repeat
- FindPics(getAt(gHighLightPos, 2))
- setAt(gCurrentPos, 3, 1)
- setAt(gHighLightPos, 3, 0)
- SetWindow1(3, 3)
- else
- if (gCurrentField = 3) and not ((HighL = 1) and (CurrentP = 1)) then
- SetWindow2(3, 12)
- repeat while the shiftDown
- SetWindow2(3, 12)
- end repeat
- end if
- end if
- end if
- dontPassEvent()
- abort()
- end if
- if the keyCode = 121 then
- if (gCurrentField = 1) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 5)))) then
- SetWindow2(1, 13)
- repeat while the shiftDown
- SetWindow2(1, 13)
- end repeat
- SetWindow1(2, 1)
- FindTerms(getAt(gHighLightPos, 1))
- setAt(gCurrentPos, 2, 1)
- setAt(gHighLightPos, 2, 0)
- SetWindow1(2, 3)
- else
- if (gCurrentField = 2) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 5)))) then
- SetWindow2(2, 13)
- repeat while the shiftDown
- SetWindow2(2, 13)
- end repeat
- FindPics(getAt(gHighLightPos, 2))
- setAt(gCurrentPos, 3, 1)
- setAt(gHighLightPos, 3, 0)
- SetWindow1(3, 3)
- else
- if (gCurrentField = 3) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 5)))) then
- SetWindow2(3, 13)
- repeat while the shiftDown
- SetWindow2(3, 13)
- end repeat
- end if
- end if
- end if
- dontPassEvent()
- abort()
- end if
- if the key = " " then
- dontPassEvent()
- abort()
- end if
- if (the keyCode = 123) or (the keyCode = 124) then
- return
- end if
- if the machineType <> 256 then
- KeyTest_Mac()
- else
- KeyTest_PC()
- end if
- end
-